<html>
  <head>
    {{ css_links }}

    <!-- Load javascript -->
    <script src="https://connect.facebook.net/en_US/all.js"></script>
    {% if is_dev_mode %}
      <script src="/static/externdeps.js"></script>
      <script src="/devjs"></script>
    {% else %}
      <script src="/static/compiled.js"></script>
    {% endif %}
  </head>
  <body onload="initApp()">
    <center>
      {{ header_html }}

      <!-- Main application -->
      <div id="applicationContainer" class="applicationContainer"></div>

      {{ footer_html }}
    </center>
    <div id="fb-root"></div>

    <!-- Javascript to initialize application -->
    <script>
      FB.init({ 
        appId: esn.FacebookApi.APP_ID,
        cookie: true, 
        status: true,
        xfbml: true,
        oauth : true
      });

      var app;
      function initApp() {
        var isDevMode = {% if is_dev_mode %}true{% else %}false{% endif %};
        app = new esn.Application({{ user_json|safe }}, {{ students_json|safe }}, isDevMode);
        app.render(document.getElementById('applicationContainer'));
      }
    </script>
  </body>
</html>
